﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Product.ascx.cs" Inherits="Admin_Views_module_Product" %>
<script src="Views/JavaScript/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="Views/JavaScript/jquery-ui-1.8.11.custom.min.js" type="text/javascript"></script>
<style type="text/css">
    .style4
    {
        font-size: medium;
    }
    .style3
    {
        width: 153px;
    }
    .style2
    {
        width: 87px;
    }
    .style5
    {
        text-align: left;
    }
</style>
<script>

    function confirm_delete() {
        if (confirm("Are you sure you want to delete ?") == true)
            return true;
        else
            return false;
    }
</script>
<form id="form1" runat="server">
    <div style="width: 951px; text-align: center;">
        <strong><span class="style4">Management Product</span></strong><br />
        <asp:DataList ID="dlProduct" runat="server" Width="946px" DataKeyField="product_id"
            OnEditCommand="dlProduct_EditCommand" 
            OnItemDataBound="dlProduct_ItemDataBound" 
            onupdatecommand="dlProduct_UpdateCommand" 
            ondeletecommand="dlProduct_DeleteCommand">
            <EditItemTemplate>
                <table style="width: 100%;">
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label1" runat="server" Text="Name Product :"></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:TextBox ID="txtNameProduct" runat="server" Text='<%# Bind("product_name") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label2" runat="server" Text="Description :"></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:TextBox ID="txtDescription" runat="server" 
                                Text='<%# Eval("product_des") %>' Height="73px" TextMode="MultiLine" 
                                Width="278px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label3" runat="server" Text="Quantity :"></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%# Eval("product_quantity") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label4" runat="server" Text="Unit ID : "></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:DropDownList ID="drlUnitID" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label5" runat="server" Text="Image :"></asp:Label>
                        </td>
                        <td class="style5" align="justify" valign="middle">
                            <asp:Image ID="Image" runat="server" Height="92px" Width="115px" ImageUrl='<%# Eval("image") %>'/>
                            &nbsp;<asp:FileUpload ID="fileUpload1" runat="server" />
                            <br />
                            <asp:Label ID="lblFileInfo" runat="server" Text='<%# Eval("image") %>'></asp:Label>
                            <br />
                            <asp:Button ID="Button6" runat="server" onclick="Button6_Click" Text="Upload" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label6" runat="server" Text="ManuFacturer :"></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:DropDownList ID="drlManuFac" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label7" runat="server" Text="Price :"></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:TextBox ID="txtPrice" runat="server" Text='<%# Eval("price") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label8" runat="server" Text="Date Add :"></asp:Label>
                        </td>
                        <td class="style5">
                            <script type="text/javascript">
                                $(function () {
                                    $("#date_added").datepicker();
                                });
                            </script>
                           <%--  <asp:TextBox ID="txtDateModified" runat="server" 
                                Text='<%# Eval("date_modified") %>'></asp:TextBox>--%>
                             
                            <div class="demo">
                                   
                                     <input id="date_added" type="text" name="date_added" value='<%# Eval("date_added") %>'>
                                 
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label9" runat="server" Text="Date Modified:"></asp:Label>
                        </td>
                        <td class="style5" id="demo-frame">
                        <script type="text/javascript">
                            $(function () {
                                $("#date_modified").datepicker();
                            });
                            </script>
                           <%--  <asp:TextBox ID="txtDateModified" runat="server" 
                                Text='<%# Eval("date_modified") %>'></asp:TextBox>--%>
                             
                            <div class="demo">
                                   
                                    <input id="date_modified" name="date_modified" type="text" value='<%# Eval("date_modified") %>'>
                            </div>
                            <!-- End demo -->
                            
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label10" runat="server" Text="Viewed :"></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:TextBox ID="txtView" runat="server" Text='<%# Eval("viewed") %>'></asp:TextBox>
                            <asp:Button ID="Button4" runat="server" onclick="Button4_Click" 
                                style="margin-top: 0px" Text="Reset " Width="54px" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label11" runat="server" Text="Sort Order :"></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:TextBox ID="txtOrder" runat="server" Text='<%# Eval("sort_order") %>'></asp:TextBox>
                            <asp:Button ID="Button5" runat="server" onclick="Button5_Click" Text="Reset" 
                                Width="54px" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style6">
                            <asp:Label ID="Label12" runat="server" Text="Status :"></asp:Label>
                        </td>
                        <td class="style5">
                            <asp:CheckBox ID="cbcStatus" runat="server" Checked='<%# Eval("status") %>' />
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <asp:Button ID="Button1" runat="server" Text="Save" CommandName="Update" />
                            &nbsp;<asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                                Text="Cancel" />
                        </td>
                    </tr>
                </table>
            </EditItemTemplate>
            <HeaderTemplate>
                <table style="width: 100%;" align="center" border="1" cellpadding="0" cellspacing="0">
                    <tr bgcolor="#00CCFF">
                        <th align="center" class="style3">
                            Action
                        </th>
                        <th align="center">
                            Product Name
                        </th>
                        <th align="center">
                            Quantity
                        </th>
                        <th align="center" class="style2">
                            ManuFacturer
                        </th>
                        <th align="center">
                            Price
                        </th>
                        <th align="center">
                            Status
                        </th>
                        <th align="center">
                            Date Add
                        </th>
                        <th align="center">
                            Viewed
                        </th>
                        <th align="center">
                            Sort Order
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td style="text-align: center">
                        <asp:ImageButton AlternateText="Edit" ImageUrl="~/image/Edit.gif" ID="EditLinkButton"
                            CommandName="Edit" Text="Edit" runat="server" />&nbsp;
                            <asp:ImageButton AlternateText="Delete"
                                ImageUrl="~/image/Delete.gif" ID="DeleteLinkButton" CommandName="Delete" Text="Delete"
                                runat="server" OnClientClick = "return confirm_delete();" />
                    </td>
                    <td style="text-align: center">
                        <%# Eval("product_name")%>
                    </td>
                    <td style="text-align: center">
                        <%# Eval("product_quantity")%>
                    </td>
                    <td style="text-align: center">
                        <%# Eval("manufacturer_id")%>
                    </td>
                    <td style="text-align: center">
                        <%# Eval("price")%>
                    </td>
                    <td style="text-align: center">
                        <%# Eval("status")%>
                    </td>
                    <td style="text-align: center">
                        <%# Eval("date_added")%>
                    </td>
                    <td style="text-align: center">
                        <%# Eval("viewed")%>
                    </td>
                    <td style="text-align: center">
                        <%# Eval("sort_order")%>
                    </td>
                </tr>
            </ItemTemplate>
        </asp:DataList>
        </table>
    </div>
</form>
